#pragma once
#include <istream>
#include <stdexcept>
#include <iostream>
using namespace std;

class Token
{
public:
    char kind;
    double value;
};

extern const char number;

class Token_stream
{
public:
    explicit Token_stream(std::istream &is);
    Token get();
    void putback(Token t);
    void ignore();

private:
    std::istream &is;
    bool full;
    Token buffer;
};

class Lexer_error : public std::runtime_error
{
    using std::runtime_error::runtime_error;
};